<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
  <title>Gestion</title>

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">

  <link type="text/css" rel="stylesheet" href="css/gestion.css">
  <link type="text/css" rel="stylesheet" href="css/datepicker.css">
  <link type="text/css" rel="stylesheet" href="themes/alphacube.css">
  <link type="text/css" rel="stylesheet" href="themes/default.css">	
  
  <script type="text/javascript" src="js/prototype.js"></script> 
  <script type="text/javascript" src="js/datepicker.js"></script> 
  <script type="text/javascript" src="js/window.js"></script> 
  <script type="text/javascript" src="js/tooltip.js"></script>
  <script type="text/javascript" src="js/je.js"></script> 
  <script type="text/javascript" src="js/compte.ajaxclt.js"></script>
</head>
<body>

<ul id="menu-header">
  <li><a href="index.php">Liste des comptes</a></li>
  <li class="current"><a href="compte.php">Opérations</a></li>
  <li><a href="recherche.php">Recherche d'opérations</a></li>
  <li><a href="budget.php">Budget</a></li>
  <li><a href="index.php?action=logout">Déconnexion</a></li>
</ul>

<h1>Bilan</h1>

<p>
<a href="?date=<?php echo $date_prec; ?>">&lt;&lt;</a>
<?php echo "$mois $annee"; ?>
<a href="?date=<?php echo $date_suiv; ?>">&gt;&gt;</a>
</p>

<h2>Compte n° <?php echo $infos_compte['numero']; ?> (<?php echo $infos_compte['libelle']; ?>)</h2>

<p>
  <a class="button" href="#" id="btn_show_debit">Nouveau debit</a>
  <a class="button" href="#" id="btn_show_credit">Nouveau crédit</a>
</p>

<!-- Tableau du bilan -->
<table class="result">
<thead>
  <tr>
    <th class="date">Date</th>
    <th class="credit">Crédit</th>
    <th class="debit">Debit</th>
    <th class="cat">Categorie</th></tr>
</thead>
<tbody id="operations">  
</tbody>  
<tfoot>
  <tr>
    <th colspan="4">Solde : <span class="montant" id="solde"></span> €</th></tr>
</tfoot>  
</table>

<h2>Par catégories</h2>

<!-- Tableau du bilan par catégories -->
<table id="bilan_categories" class="result">
</table>

<!-- Formulaire de nouvelle opération -->
<div id="div_new_op">
  <form action="compte.php" method="post">
    <div>
    <input type="hidden" name="action" value="add_op">
    <input type="hidden" name="type" id="type">
    <input type="hidden" id="id_op" value="">    
    </div>
    
    <table>
    <tr>
      <td><label for="input_date">Date</label></td>
      <td><input type="text" name="date" id="input_date" class="date">
        <input type=button value="..." id="btn_dp_date"></td></tr>
    <tr>
      <td><label for="input_montant">Montant</label></td>
      <td><input type="text" name="montant" id="input_montant" class="montant"></td></tr>
    <tr>
      <td><label for="select_categories">Catégorie</label></td>
      <td><select name="cat" id="select_categories"></select>
        <input type="button" id="btn_add_categorie" value="+">
        <input type="text" name="new_cat" id="input_newcat">
        <input type="button" value="Ajouter" id="btn_new_cat">
        <input type="button" id="btn_close_categories" value="-"></td></tr>
    <tr>
      <td colspan="2"><label for="txt_infos">Informations complementaires :</label>
      <br>
      <textarea name="infos" id="txt_infos" rows="3" cols="40"></textarea></td></tr>
    </table>  
    
    <p><input type="submit" id="btn_submit_operation" value="Ajouter"></p>
  </form>
</div>

</body>
</html>
